package sanshui.system.trade.factory.trade.cronTask;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import sanshui.system.trade.service.IWorkerService;
import sanshui.system.trade.util.CommonTimeUtil;

import java.time.LocalDateTime;


@Slf4j
@Component
public class CronTradeTask {

    @Autowired
    IWorkerService workerService;

    @Scheduled(cron = "0 30 23 * * ?")
    public void clearBackWorker(){
        LocalDateTime time = LocalDateTime.now().minusDays(1);
        workerService.clearWorker(CommonTimeUtil.getNowTime16(time));
    }
}
